home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / noghst / noghost.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-08  |  3.6 KB  |  92 lines

  1. VERSION 2.00
  2. Begin Form MainForm 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "NoGhost TestApp"
  5.    ClientHeight    =   3930
  6.    ClientLeft      =   1020
  7.    ClientTop       =   1710
  8.    ClientWidth     =   7350
  9.    Height          =   4620
  10.    Icon            =   NOGHOST.FRX:0000
  11.    Left            =   960
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   3930
  14.    ScaleWidth      =   7350
  15.    Top             =   1080
  16.    Width           =   7470
  17.    Begin Label Label1 
  18.       AutoSize        =   -1  'True
  19.       BackColor       =   &H00C0C0C0&
  20.       Height          =   195
  21.       Left            =   120
  22.       TabIndex        =   0
  23.       Top             =   120
  24.       Width           =   7095
  25.       WordWrap        =   -1  'True
  26.    End
  27.    Begin Menu FileMenu 
  28.       Caption         =   "&File"
  29.       Begin Menu ExitChoice 
  30.          Caption         =   "E&xit"
  31.       End
  32.    End
  33.    Begin Menu ConfigureMenu 
  34.       Caption         =   "&Configuration"
  35.       Begin Menu EnableChoice 
  36.          Caption         =   "&Enable Processing"
  37.          Checked         =   -1  'True
  38.       End
  39.       Begin Menu SizingOption 
  40.          Caption         =   "&Sizeable"
  41.          Checked         =   -1  'True
  42.       End
  43.    End
  44. DefInt A-Z
  45. Declare Function RegNoGhost Lib "noghost.dll" (ByVal hWnd%, ByVal AllowSizing%, ByVal OnOff%) As Integer
  46. Const lblMult = .9
  47. Dim lblString$
  48. Sub EnableChoice_Click ()
  49.     EnableChoice.Checked = Not (EnableChoice.Checked)
  50.     If EnableChoice.Checked Then
  51.         ErrCode = RegNoGhost(MainForm.hWnd, True, False)
  52.         ErrCode = RegNoGhost(MainForm.hWnd, SizingOption.Checked, True)
  53.     Else
  54.         ErrCode = RegNoGhost(MainForm.hWnd, SizingOption.Checked, False)
  55.     End If
  56. End Sub
  57. Sub ExitChoice_Click ()
  58.     ErrCode = RegNoGhost(MainForm.hWnd, True, False)
  59.     Unload MainForm
  60. End Sub
  61. Sub Form_Load ()
  62.     lblString$ = "NoGhost is a tool which allows Visual Basic applications to respond to Cascade and Tile messages properly.  It also behaves properly when the Visual Basic application is minimized and does not detract from the Cascading or Tiling of other applications.  NoGhost is programmer configurable to allow or disallow sizing of the Visual Basic application's window.  "
  63.     lblString$ = lblString$ + "Try this sample program to get an idea how the control works.  Turning off the Enable Processing option will show you how Visual Basic applications normally behave.  "
  64.     lblString$ = lblString$ + "NoGhost only requires 5K of memory and one simple call to a DLL function."
  65.     lblString$ = lblString$ + Chr$(13) + Chr$(10) + Chr$(13) + Chr$(10) + "By Greg Blaum - CIS: 71212,1763"
  66.     lblString$ = lblString$ + Chr$(13) + Chr$(10) + "Copyright 1993"
  67.     lblString$ = lblString$ + Chr$(13) + Chr$(10) + "NoGhost is FREEWARE, suggestions or questions are welcome"
  68.     ErrCode = RegNoGhost(MainForm.hWnd, True, True)
  69.     Label1.Caption = lblString$
  70.     Label1.Refresh
  71. End Sub
  72. Sub Form_Resize ()
  73.     If WindowState <> 1 Then
  74.         Label1.Visible = False
  75.         Label1.Width = lblMult * MainForm.Width
  76.         Label1.Refresh
  77.         Label1.Visible = True
  78.     End If
  79. End Sub
  80. Sub Form_Unload (Cancel As Integer)
  81.     ErrCode = RegNoGhost(MainForm.hWnd, True, False)
  82. End Sub
  83. Sub SizingOption_Click ()
  84.     SizingOption.Checked = Not (SizingOption.Checked)
  85.     If EnableChoice.Checked Then
  86.         ErrCode = RegNoGhost(MainForm.hWnd, True, False)
  87.         ErrCode = RegNoGhost(MainForm.hWnd, SizingOption.Checked, True)
  88.     Else
  89.         ErrCode = RegNoGhost(MainForm.hWnd, SizingOption.Checked, False)
  90.     End If
  91. End Sub
  92.